<template>
  <basic-container>
    <header>
      <el-row>
        <el-col :span="10" align="start">首页快捷入口管理</el-col>
        <el-col :span="14" align="end">
          <el-button type="primary" @click="createdHandle">创建快捷入口</el-button>
        </el-col>
      </el-row>
    </header>
    <div class="container">
      <p
        style="
          font-size: 12px;
          font-family: SourceHanSansSC-Regular, SourceHanSansSC;
          font-weight: 400;
          color: #989da3;
          line-height: 18px;
        "
      >
        最多支持8个快捷入口
      </p>
      <el-table stripe :data="tableData">
        <el-table-column prop="date" width="250" label="快捷入口名称">
          <template #default="scope">
            <img class="zydx-img" src="@/assets/images/business-system/work-manage-lczydx.png" alt="" srcset="" />{{
              scope.row.date
            }}
          </template>
        </el-table-column>
        <el-table-column prop="name" label="展示预览">
          <template #default>
              <img class="zybz-img" src="@/assets/images/business-system/work-manage-lczybz.png" alt="" srcset="" />
          </template>
        </el-table-column>
        <el-table-column prop="name" label="跳转路径">
          <template #default="scope">
            {{ scope.row.menu }}
          </template>
        </el-table-column>
        <el-table-column prop="address" width="200" align="center" label="操作（编辑/是否展示）">
          <template #default="scope">
            <el-button link type="primary" size="small" @click="editHandle(scope.row)">编辑</el-button>
            <el-button link type="primary" size="small" @click="handleClick">
              <el-switch v-model="scope.row.value1" />
            </el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </basic-container>
</template>
<script setup>
const tableData = ref([
  {
    date: '底稿编写',
    address: 'No. 189, Grove St, Los Angeles',
    menu: '项目管理/底稿管理',
  },
  {
    date: '整改反馈',
    address: 'No. 189, Grove St, Los Angeles',
    menu: '项目管理/底稿管理',
  },
  {
    date: '计划管控',
    name: ['tome', 'tome', 'tome', 'tome'],
    address: 'No. 189, Grove St, Los Angeles',
    menu: '项目管理/底稿管理',
  },
  {
    date: '报告验收',
    address: 'No. 189, Grove St, Los Angeles',
    menu: '项目管理/底稿管理',
  },
]);
// 创建快捷入口方法
const router = useRouter();


const createdHandle = () => {
  const v = {
    date: '',
  };
  router.push({ name: 'addPage',  query: { v: JSON.stringify(v) } });
};
const editHandle = (v) => {
  router.push({ name: 'addPage', query: { v: JSON.stringify(v) } });
};
</script>
<style lang="scss" scoped>
header {
  .el-col-10 {
    background-color: #f0f2f5;
    font-size: 16px;
    font-family: SourceHanSansSC-Bold, SourceHanSansSC;
    font-weight: bold;
    color: #25292c;
    line-height: 42px;
    height: 50px;
  }
  .el-col-14 {
    background-color: #f0f2f5;
    height: 50px;
    padding-right: 20px;
  }
}
::v-deep .el-table th.el-table__cell {
  background: #f6f8fa !important;
  font-size: 14px;
  font-family: SourceHanSansSC-Medium, SourceHanSansSC;
  font-weight: 500;
  color: #25292c;
  line-height: 20px;
  height: 50px;
}
.container {
  height: calc(100vh - 208px);
  padding: 5px 15px 5px 15px;
  .el-table {
    height: calc(100vh - 300px);
    border-left: 1px solid #dadde5;
    border-top: 1px solid #dadde5;
    border-right: 1px solid #dadde5;
    tr {
      background-color: #f6f8fa !important;
    }
    .zydx-img {
      margin-right: 10px;
      width: 10px;
    }
    .zybz-img {
      margin-right: 10px;
      width: 15px;
      vertical-align: bottom;
    }
    .empty-status {
      font-size: 14px;
      font-family: SourceHanSansSC-Regular, SourceHanSansSC;
      font-weight: 400;
      color: #989da3;
      line-height: 20px;
    }
    .zybz-container {
      display: inline-block;
      background: #f9fafb;
      width: fit-content;
      padding: 5px 30px 5px 5px;
      margin: 8px;
    }
  }
}
</style>
